package org.aersoft.jokebook.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.readystatesoftware.sqliteasset.SQLiteAssetHelper;

/**
 * Helper class to get the database connection.
 * @author Danilo de Godoy Carolino.
 */
public class DatabaseHelper extends SQLiteAssetHelper {

	/**
	 * An instance of {@link SQLiteDatabase} library.
	 */
	public SQLiteDatabase dataBase;

	/**
	 * Constructor method of helper class. Install the database or force your
	 * upgrade if it exists.
	 * @param context do tipo {@link Context}
	 */
	public DatabaseHelper(Context context) {
		super(context, DatabaseConstants.DATABASE_NAME, context.getExternalFilesDir(DatabaseConstants.DATABASE_FOLDER_PATH).getAbsolutePath(), null, DatabaseConstants.DATABASE_VERSION);
		setForcedUpgradeVersion(DatabaseConstants.DATABASE_VERSION);
	}

}